﻿@model IEnumerable<BatsMVCPortal.Models.Blog>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            User
        </th>
        <th>
            BlogTitle
        </th>
        <th>
            BlogDescription
        </th>
        <th>
            BlogType
        </th>
        <th>
            BlogDateAdd
        </th>
        <th>
            BlogRating
        </th>
        <th>
            BlogCountVote
        </th>
        <th>
            BlogCountUser
        </th>
        <th>
            BlogAvatar
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.User.UserLogin)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogTitle)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogDescription)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogType)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogDateAdd)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogRating)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogCountVote)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogCountUser)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BlogAvatar)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.BlogId }) |
            @Html.ActionLink("Details", "Details", new { id=item.BlogId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.BlogId })
        </td>
    </tr>
}

</table>
